package com.zpark.entity.patients;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 患者健康信息表
 * @TableName patient_health_info
 */
@TableName(value ="patient_health_info")
@Data
public class PatientHealthInfo implements Serializable {
    /**
     * 健康信息ID
     */
    @TableId(value = "health_id", type = IdType.AUTO)
    private Long healthId;

    /**
     * 患者ID
     */
    @TableField(value = "patient_id")
    private Long patientId;

    /**
     * 患者姓名
     */
    @TableField(value = "patient_name")
    private String patientName;

    /**
     * 血型：A型,B型,AB型,O型,其他
     */
    @TableField(value = "blood_type")
    private String bloodType;

    /**
     * 过敏史
     */
    @TableField(value = "allergy")
    private String allergy;

    /**
     * 慢性病史
     */
    @TableField(value = "chronic_disease")
    private String chronicDisease;

    /**
     * 家族病史
     */
    @TableField(value = "family_disease")
    private String familyDisease;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PatientHealthInfo other = (PatientHealthInfo) that;
        return (this.getHealthId() == null ? other.getHealthId() == null : this.getHealthId().equals(other.getHealthId()))
            && (this.getPatientId() == null ? other.getPatientId() == null : this.getPatientId().equals(other.getPatientId()))
            && (this.getPatientName() == null ? other.getPatientName() == null : this.getPatientName().equals(other.getPatientName()))
            && (this.getBloodType() == null ? other.getBloodType() == null : this.getBloodType().equals(other.getBloodType()))
            && (this.getAllergy() == null ? other.getAllergy() == null : this.getAllergy().equals(other.getAllergy()))
            && (this.getChronicDisease() == null ? other.getChronicDisease() == null : this.getChronicDisease().equals(other.getChronicDisease()))
            && (this.getFamilyDisease() == null ? other.getFamilyDisease() == null : this.getFamilyDisease().equals(other.getFamilyDisease()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getHealthId() == null) ? 0 : getHealthId().hashCode());
        result = prime * result + ((getPatientId() == null) ? 0 : getPatientId().hashCode());
        result = prime * result + ((getPatientName() == null) ? 0 : getPatientName().hashCode());
        result = prime * result + ((getBloodType() == null) ? 0 : getBloodType().hashCode());
        result = prime * result + ((getAllergy() == null) ? 0 : getAllergy().hashCode());
        result = prime * result + ((getChronicDisease() == null) ? 0 : getChronicDisease().hashCode());
        result = prime * result + ((getFamilyDisease() == null) ? 0 : getFamilyDisease().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", healthId=").append(healthId);
        sb.append(", patientId=").append(patientId);
        sb.append(", patientName=").append(patientName);
        sb.append(", bloodType=").append(bloodType);
        sb.append(", allergy=").append(allergy);
        sb.append(", chronicDisease=").append(chronicDisease);
        sb.append(", familyDisease=").append(familyDisease);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}